package com.Deome.Class13;

import java.util.HashSet;
import java.util.Iterator;

public class Namede {
    public static void main(String[] args) {
        HashSet<String>names=new HashSet<>();
        names.add("刘备");
        names.add("关羽");
        names.add("张飞");
        names.add("刘备");
        names.add("张飞");
        System.out.println(names);
        Iterator<String>it=names.iterator();
        while (it.hasNext()){
            String x=it.next();
            System.out.println(x);
        }
        System.out.println();
        for (String x:names){
            System.out.println(x);
        }
    }
}
